﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace NurseStation.common
{
    /// <summary>
    /// 消息提示工具类  2022-03-01
    /// </summary>
    public class NotifiactionHelper
    {
        private static readonly Lazy<NotifiactionHelper> _lazy =
         new Lazy<NotifiactionHelper>(() => new NotifiactionHelper(), LazyThreadSafetyMode.PublicationOnly);

        readonly Notifiaction notifiaction = Notifiaction.Instance;

        /// <summary>
        /// 单例对象  2022-03-01
        /// </summary>
        public static NotifiactionHelper Instance
        {
            get
            {
                return _lazy.Value;
            }
        }

        /// <summary>
        /// 消息提示  2022-03-01
        /// </summary>
        /// <param name="content"></param>
        /// <param name="title"></param>
        /// <param name="proType"></param>
        public void ShowMessage(string title, string content,  EnumPromptType proType)
        {
            notifiaction.Dispatcher.BeginInvoke(new Action(() =>
            {
                notifiaction.AddNotifiaction(new NotifiactionModel()
                {
                    Title = title,
                    Content = content,
                    NotifiactionType = proType
                });
            }));
        }
    }
}
